home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frmAddItemTest Caption = "AddItem Test Form" ClientHeight = 5010 ClientLeft = 870 ClientTop = 1530 ClientWidth = 4800 Height = 5415 Left = 810 LinkMode = 1 'Source LinkTopic = "Form1" ScaleHeight = 5010 ScaleWidth = 4800 Top = 1185 Width = 4920 Begin CommandButton pbWithOutNULL Caption = "Insert Without NULL" Height = 492 Left = 2400 TabIndex = 2 Top = 4320 Width = 1812 End Begin CommandButton pbWithNULL Caption = "Insert With NULL" Height = 492 Left = 360 TabIndex = 1 Top = 4320 Width = 1692 End Begin ListBox lstBox Height = 2760 Left = 480 TabIndex = 0 Top = 1200 Width = 3975 End Begin Label Label1 Caption = "frmAddItem.Load calls GetPrivateProfileString (which is exported in KERNEL.EXE) and retrieves a NULL terminated string from WIN.INI. The pushbuttons invoke AddItem with a string expression; they concat a string literal, replacing or ignoring the NULLs" FontBold = -1 'True FontItalic = 0 'False FontName = "MS Serif" FontSize = 6.75 FontStrikethru = 0 'False FontUnderline = 0 'False ForeColor = &H00000000& Height = 972 Left = 120 TabIndex = 3 Top = 120 Width = 4572 End ' Form Level Variable Declarations Dim strReturned As String * 30 Sub Form_Load () iReturn% = GetProfileString("Extensions", "wri", "Nothing Returned", strReturned, Len(strReturned)) End Sub Sub pbWithNULL_Click () ' Local Variable Declarations Dim strItem As String * 30 strItem = strReturned lstBox.AddItem strItem + " *** With NULL ***" End Sub Sub pbWithOutNULL_Click () ' Local Variable Declarations Dim strItem As String * 30 strItem = strReturned iPosition% = InStr(1, strItem, Chr$(0)) Mid$(strItem, iPosition%) = Space$((Len(strItem) - iPosition%) + 1) lstBox.AddItem strItem + " *** Without NULL ***" End Sub